package com.night.icm.persistence.base.repository;

import com.night.icm.persistence.base.entity.ConfigurationInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * ConfigurationInfoRepository
 *
 * @author Liao ZhiYong
 * @date 2020/1/24
 */
@Repository
public interface ConfigurationInfoRepository extends JpaRepository<ConfigurationInfo, Long>, JpaSpecificationExecutor<ConfigurationInfo> {

    /**
     * 通过参数名查询全局参数
     *
     * @param name 参数名
     * @return 参数ID
     */
    @Query("select c.id from ConfigurationInfo as c where c.name = :name")
    Long findConfigurationInfoByName(@Param("name") String name);
}
